The purpose of a program understanding tool is to help improve a programmer's comprehension of an existing software system. Toward this goal, some program understanding tools will present certain calling relationships observed in the software system, such as control flow and inter-function calls, to the programmer in a graphical format. The major benefit of displaying this information as a graph is that the calling relationships between the nodes are readily visible. This representation allows the programmer to see, at a glance, how the nodes of the graph are hierarchically related, how certain nodes may be reached, and how each node in the graph relates to the rest of the nodes in the graph. One problem with this technique is that, as the complexity of the displayed graph increases, the utility of the graph to the end user is diminished. In fact for extremely complex graphs, this problem can become so severe that the displayed graph is essentially useless for the purpose of program understanding.
One of the most important factors that determines the complexity of a graph is the relationship between the number of nodes and arcs it contains. One measure of this complexity was proposed by the U.S. National Bureau of Standards (NBS Special Publication 500-99, issued December 1982) as the "cyclomatic number". This is used for measuring the complexity of a graph. This cyclomatic complexity measure may be determined for a given graph, G, by performing the following calculation: EQU CyclomaticComplexity(G)=NumArcs(G)-NumNodes(G)+2(NumComponents)
"NumComponents" in the previous equation is equal to the number of disconnected subcomponents that comprise the graph G. Examples of graphs with a complexity number of up to 12 appear to be usable for the purposes of program understanding. However, examples with a complexity of 47 appears to be pushing the limits of usability. In this case, the relationships between the nodes in the graph may become hidden by the large number of arcs in the graph. In the analysis of real programs in the prior art, programs with complexity values in the hundreds are not at all uncommon. Some programs have even been seen with complexity values in the thousands.
It is an object of the present invention to provide a system and method for simplified computer display of computer program structure.